Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the cors middleware to address the KeyError via issue #767 #882

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ulmentflam
Copy link
Contributor

No description provided.

@ulmentflam
Copy link
Contributor Author

If anyone needs this fix before it is merged in, you can add the CORSMiddleware class to a file in your project and import the new CORSMiddleware class and add it in the same way you add other middleware. For example:

# In your imports
from {your_project}.{file_with_middleware_class_from_this_pr} import CORSMiddleware

# After you create the Hug API
api.http.add_middleware(CORSMiddleware(api, allow_origins=['*'], max_age=10))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants